package com.hnguigu.health.houduan.lq.service_lq.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hnguigu.health.houduan.lq.service_lq.TTemplatemanageService;
import com.hnguigu.health.mapper.TDiettemplateselectedMapper;
import com.hnguigu.health.mapper.TMovingtemplateselectionMapper;
import com.hnguigu.health.mapper.TTemplatemanageMapper;
import com.hnguigu.health.pojo.TDiettemplateselected;
import com.hnguigu.health.pojo.TMovingtemplateselection;
import com.hnguigu.health.pojo.TTemplatemanage;
import com.hnguigu.health.utils.forManage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TTemplatemanageServiceImpl  implements TTemplatemanageService {
    @Autowired(required = false)
    TTemplatemanageMapper tTemplatemanageMapper;
    @Autowired(required = false)
    TMovingtemplateselectionMapper tMovingtemplateselectionMapper;
    @Autowired(required = false)
    TDiettemplateselectedMapper tDiettemplateselectedMapper;
    @Override
    public PageInfo<TTemplatemanage> selectAllTTemplatemanage(int page, int num, String content) {
        PageHelper.startPage(page,num);
        return new PageInfo<>(tTemplatemanageMapper.selectAllTTemplatemanage(content));
    }

    @Override
    public List<TTemplatemanage> AllTTemplatemanage() {
        return tTemplatemanageMapper.AllTTemplatemanage();
    }

    @Override
    public int insertSelective(TTemplatemanage record) {
        return tTemplatemanageMapper.insertSelective(record);
    }

    @Override
    public TTemplatemanage Lastbean() {
        return tTemplatemanageMapper.Lastbean();
    }

    @Override
    public int forInsertTd(forManage forManage) {
        return tDiettemplateselectedMapper.forInsertTd(forManage);
    }

    @Override
    public int forInsertTm(forManage forManage) {
        return tMovingtemplateselectionMapper.forInsertTm(forManage);
    }

    @Override
    public int deleteByManageId(String mangeId) {
        return tTemplatemanageMapper.deleteByManageId(mangeId);
    }

    @Override
    public int updateByManageId(String mangeId) {
        return tTemplatemanageMapper.updateByManageId(mangeId);
    }

    @Override
    public int updateByManageId2(String mangeId) {
        return tTemplatemanageMapper.updateByManageId2(mangeId);
    }
}
